<?php
//
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$setting=$return['pluginset'];
if($_RQ['op']=='main'){
	$return['ischecklogin']=model('core/core')->checklogin('','',true);
	$params=array('status'=>1,'uniacid'=>$_SESSION['uniacid']);
	if(!empty($_RQ['keyword'])){
		$params['title like']='%'.$_RQ['keyword'].'%';
		$return['params']['title']=$_RQ['keyword'];
	}
	$return['list']=pdo_getall('jy_daibao_yewu',$params,array('id','title','fee','image','desc'),'','paixu desc,id desc');
	$setting['bankuai1'] =  !empty($setting['bankuai1']) ? $setting['bankuai1'] : $bankuai1;
	$setting['footernav'] = !empty($setting['footernav']) ? $setting['footernav'] : $footernav;
	$return['pcd']=$this->session('pcd')?:array('city'=>'');
	if($return['pcd']){
		$address=$return['pcd']['province'].' '.$return['pcd']['city'];
		$code=pdo_getcolumn('core_area',array('address'=>$address),'parent_code');
	}
	$return['sharedata']=array(
		'title'=>$setting['share_title'],
		'desc'=>$setting['share_desc'],
		'link'=>custom_url('jy_daibao/index//code='.$code,true),
		'imgUrl'=>tomedia($setting['share_image']),
	);
	$return['params']=array('isbao'=>-1,'paytype'=>-1,'sex'=>-1,'xueli'=>-1);
	$return['setting']=$setting;
	$return['member']=pdo_get('core_members',array('id'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']),array('createtime','credit1','credit2','mobile','avatar','nickname'));
	$return['notices']=pdo_getall('core_account_article',array('uniacid'=>$_SESSION['uniacid'],'status'=>'1'),'','id desc');
	$return['xueli_type']=$this->xueli_type;
	$return['job_paytype']=$this->job_paytype;
	$return['job_isbao']=$this->job_isbao;
	set_html('title',$setting['title']?$setting['title'] :'企业服务');
	exi($return);
}	
if($_RQ['op']=='getpcd'){
	if(!empty($_RQ['keyword'])){
			$params['title like']='%'.$_RQ['keyword'].'%';
			$return['params']['title']=$_RQ['keyword'];
	}
	$areas=cfc('area')->get_pcd_titlelist($_RQ['keyword']);
	$return['areas']=$areas;
	exi($return);
}
if($_RQ['op']=='uppcd'){
	$post=get_postdata();
	if($post['lat'] || $post['lng']){
		$lat_lng=array('lat'=>$post['lat'],'lng'=>$post['lng']);
		$this->session('lat_lng',$lat_lng);
	}
	$this->session('pcd',$post);
	//print_r($this->session('pcd'));exit;
	exi('更新成功！');
}
?>